﻿// Copyright (c) Microsoft Corporation
// All rights reserved.
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License.  You may obtain a copy
// of the License at http://www.apache.org/licenses/LICENSE-2.0
// 
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
// 
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.

//
// This example illustrates some programming techniques related to interaction with Microsoft Azure HDInsight service.
// It also illustrate the usage of Microsoft Avro Library
// To run this sample you need to have an active Azure Subscription together with provisioned HDInsight cluster
// You also need to edit App.config file and insert the required Azure Subscription information before building the sample
// (or you can edit AvroHDISample.exe.config after the build)
//
// AvroHDISample.cs contains the major classes and methods required for the sample.
//
// Cluster.cs contains all classes that work directly with Microsoft Azure HDInsight clusters
//
// This file (Stock.cs) contains a definition of Stock class which is used to represent the sample data.
// Stock.cs is auto-generated from JSON schema using Microsoft Avro Library Code Generation utility
//

//<auto-generated />
namespace Microsoft.Hadoop.Avro.Sample
{
    using System;
    using System.Collections.Generic;
    using System.Runtime.Serialization;
    using Microsoft.Hadoop.Avro;

    /// <summary>
    /// Used to serialize and deserialize Avro record Microsoft.Hadoop.Avro.Sample.Stock.
    /// </summary>
    [DataContract(Namespace = "Microsoft.Hadoop.Avro.Sample")]
    public partial class Stock
    {
        private const string JsonSchema = @"{""type"":""record"",""name"":""Microsoft.Hadoop.Avro.Sample.Stock"",""fields"":[{""name"":""Symbol"",""type"":""string""},{""name"":""StockDate"",""type"":""string""},{""name"":""OpenPrice"",""type"":""float""},{""name"":""HighPrice"",""type"":""float""},{""name"":""LowPrice"",""type"":""float""},{""name"":""ClosePrice"",""type"":""float""},{""name"":""Volume"",""type"":""long""},{""name"":""AdjustedClosePrice"",""type"":""float""}]}";

        /// <summary>
        /// Gets the schema.
        /// </summary>
        public static string Schema
        {
            get
            {
                return JsonSchema;
            }
        }

        /// <summary>
        /// Gets or sets the Symbol field.
        /// </summary>
        [DataMember]
        public string Symbol { get; set; }

        /// <summary>
        /// Gets or sets the StockDate field.
        /// </summary>
        [DataMember]
        public string StockDate { get; set; }

        /// <summary>
        /// Gets or sets the OpenPrice field.
        /// </summary>
        [DataMember]
        public float OpenPrice { get; set; }

        /// <summary>
        /// Gets or sets the HighPrice field.
        /// </summary>
        [DataMember]
        public float HighPrice { get; set; }

        /// <summary>
        /// Gets or sets the LowPrice field.
        /// </summary>
        [DataMember]
        public float LowPrice { get; set; }

        /// <summary>
        /// Gets or sets the ClosePrice field.
        /// </summary>
        [DataMember]
        public float ClosePrice { get; set; }

        /// <summary>
        /// Gets or sets the Volume field.
        /// </summary>
        [DataMember]
        public long Volume { get; set; }

        /// <summary>
        /// Gets or sets the AdjustedClosePrice field.
        /// </summary>
        [DataMember]
        public float AdjustedClosePrice { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="Stock"/> class.
        /// </summary>
        public Stock()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Stock"/> class.
        /// </summary>
        /// <param name="symbol">The symbol.</param>
        /// <param name="stockDate">The stockDate.</param>
        /// <param name="openPrice">The openPrice.</param>
        /// <param name="highPrice">The highPrice.</param>
        /// <param name="lowPrice">The lowPrice.</param>
        /// <param name="closePrice">The closePrice.</param>
        /// <param name="volume">The volume.</param>
        /// <param name="adjustedClosePrice">The adjustedClosePrice.</param>
        public Stock(string symbol, string stockDate, float openPrice, float highPrice, float lowPrice, float closePrice, long volume, float adjustedClosePrice)
        {
            this.Symbol = symbol;
            this.StockDate = stockDate;
            this.OpenPrice = openPrice;
            this.HighPrice = highPrice;
            this.LowPrice = lowPrice;
            this.ClosePrice = closePrice;
            this.Volume = volume;
            this.AdjustedClosePrice = adjustedClosePrice;
        }
    }
}